package cn.sh.library.mgts.utils;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//@Service
public class Task {
	
	
	
//	@Async("taskExecutor")
	public void doTaskOne() throws Exception {
//        log.info("开始做任务一");
//        long start = System.currentTimeMillis();
//        Thread.sleep(random.nextInt(10000));
//        long end = System.currentTimeMillis();        log.info(stringRedisTemplate.randomKey());
//        log.info("完成任务一，耗时：" + (end - start) + "毫秒");
    }
	
	public static void main(String[] args) {
		String sss = "1234 567\n\t890\n\t110A ";
		
		System.out.println(sss.split("[\\t \\n]+"));
		
		
//		System.out.println(DateUtils.getFragmentInDays(new Date(), Calendar.MONTH));
//		
//		String sqlString = "SELECT [item#] as itemno,[ibarcode],[bib#] as bibno,[location],[collection],[call_reconst]\r\n"
//				+ "      ,[copy_reconst],[itype],[call_type],[creation_date],[last_update_date]\r\n"
//				+ "  FROM [olapCirc].[dbo].[_hor_item] a" 
////				+ "  where a.bib#>= (" + batch+ "-1) * 1000 and a.bib# < " + batch + " * 1000"
//				+ " WHERE 1=1\r\n" + 
//				" and exists(select 1 from(select bib#, row_number() over(order by c.change_datetime) as rn \r\n" + 
//				"	from [olapCirc].[dbo].[_hor_item_update] c \r\n" + 
//				"	where  c.change_action in ('update', 'add') \r\n" + 
//				" 	and c.change_datetime>= '2019-06-30 21:27:33.533' \r\n" + 
//				"    and c.change_datetime < '2019-07-01 22:27:33.533'\r\n" + 
//				"	)c where bib# = b.bib# and rn > (1 - 1)*1000 and rn <= 1*1000\r\n" + 
//				"	)"
//				+ "  order by a.bib#";
//		System.out.println(sqlString);
//		
//		System.out.println(DateFormatUtils.format(new Date(), "yyyy-MM-dd' 'HH:mm:ss.SSS"));;
		try {
			System.out.println(DateUtils.parseDate("2019-07-02 17:22:24.340", "yyyy-MM-dd' 'HH:mm:ss.SSS"));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
